<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
          window.onload = function(){
             var brands = ["奔驰","宝马","奥迪"];
             var ul = document.createElement("ul");
             for (var k in brands) {
                 console.log(k);
                 var li = document.createElement("li");
                 var txt = document.createTextNode(brands[k]);
                 li.appendChild(txt);
                 ul.appendChild(li);
                 
                li.addEventListener("mousemove", function(){
                    this.style.backgroundColor = "gray";
                 });
                li.addEventListener("mouseout", function(){
                    this.style.backgroundColor = "";
                 })
             }
             document.body.appendChild(ul);
          }
       </script>
	</head>
	<body>
	</body>
</html>
